import http from '@/utils/http'
import qs from 'qs';

// 获取待接订单列表数据
export const getOrderList = (params) => {
	return http.get('/p?service=accompanying&operation=orderlist', params);
}

// 获取待接订单详情
export const getOrderDetail = (params) => {
	return http.get('/g?service=accompanying&operation=orderdetail', params);
}

// 接单
export const receiveOrder = (params) => {
	return http.get('/p?service=accompanying&operation=orderconfirm', params);
}

// 获取当前用的订单列表数据
export const getReceiveOrderList = (params) => {
	return http.get('/p?service=accompanying&operation=accompanyingrecord', params);
}

// 获取已接订单详情
export const getReceiveOrderDetail = (params) => {
	return http.get('/p?service=accompanying&operation=accompanyingdetail', params);
}

// 发送客户提醒
export const sendRemind = (params) => {
	return http.get('/p?service=accompanying&operation=remindclientmsg', params);
}

// 变更服务状态(status:6到达医院9服务开始10服务结束)
export const changeOrderStatus = (params) => {
	return http.get('/p?service=accompanying&operation=arrivehospital', params);
}

// 获取病历本图片列表数据
export const getMedicalRecordList = (params) => {
	return http.get('/g?service=accompanying&operation=medicalrecordlist', params);
}

// 上传病历本图片
export const addMedicalRecord = (params) => {
	return http.post('/p?service=accompanying&operation=addmedicalrecord', params, {
		"Content-Type": "multipart/form-data"
	});
}

// 删除病历夹图片
export const delMedicalRecord = (params) => {
	return http.get('/p?service=accompanying&operation=deletemedicalrecord', params);
}

// 获取服务策划内容
export const getPlan = (params) => {
	return http.get('/g?service=accompanying&operation=getNewServicePlan', params);
}

// 提交服务策划内容
export const savePlan = (params) => {
	return http.get('/p?service=accompanying&operation=saveNewServicePlan', params);
}

// 获取服务总结详情
export const getSummary = (params) => {
	return http.get('/p?service=accompanying&operation=getservicesummary', params);
}

// 提交服务总结
export const saveSummary = (params, extra) => {
	return http.post(`/p?service=accompanying&operation=saveservicesummary&${qs.stringify(params)}`, qs.stringify(
		extra), {
		"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
	});
}
